package thread.join;

public class ThreadOne extends Thread{
    @Override
    public void run() {
        System.out.println("线程一开始");
        ThreadTwo two = new ThreadTwo();
        two.start();
        try {
            two.join(2000);
            /*
            two.wait()阻塞的不是线程two，而是当前执行线程本身即one
           */

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("线程一结束");
    }
}
